<%@ page language="java" contentType="text/html; charset=utf-8"
    pageEncoding="utf-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>巡检周报</title>
<link rel="stylesheet" type="text/css" href="../ext/resources/css/ext-all.css"></link>
<link rel="stylesheet" type="text/css" href="../ext/resources/css/xtheme-slate.css"></link>
<script src="../ext/adapter/ext/ext-base.js"></script>
<script src="../ext/ext-all.js"></script>
<script src="../ext/src/locale/ext-lang-zh_CN.js"></script>	
<script src="../ext/base/PagingMemoryProxy.js"></script>	
<script type="text/javascript">
Ext.onReady(function(){
	Ext.Ajax.on('requestcomplete',checkUserSessionStatus, this);      
	function checkUserSessionStatus(conn,response,options){      
	    if(response.getResponseHeader('sessionstatus')){      
	    	parent.location.href='/xdj/index.jsp';   
	    }      
	}  
	Ext.BLANK_IMAGE_URL='ext/resources/images/default/s.gif';
	
	
	//表格
	var sm = new Ext.grid.CheckboxSelectionModel();//列的复选框
	var cm=new Ext.grid.ColumnModel([
		new Ext.grid.RowNumberer(),  //自动增加序列号
		sm, //加到每列的前边
		{header:'报告编号',dataIndex:'id',sortable:true}, //True表示为可在该列上进行排列
		{header:'填写日期',dataIndex:'datetime'},
		{header:'填写人工号',dataIndex:'number'},
		{header:'填写人姓名',dataIndex:'name'},
		{header:'报告状态',dataIndex:'status'},
		{header:'检索关键字',dataIndex:'primaryKey'},
		{header:'月报文件名',dataIndex:'monthname'},
		{header:'备注',dataIndex:'remark'}
	]);//定义相应的列模型


	var data=[
	['1','部长','维护巡检线路','aa','aaaa','sss','wwwww','qqqqq']
	];//定义数据段
	var store=new Ext.data.Store({
		//proxy:new Ext.data.MemoryProxy(data),
		proxy:new Ext.data.PagingMemoryProxy(data),
		reader:new Ext.data.ArrayReader({},[
			{name:'id'},
			{name:'datetime'},
			{name:'number'},
			{name:'name'},
			{name:'status'},
			{name:'primaryKey'},
			{name:'monthname'},
			{name:'remark'}
		])
	});//存储前两项的定义的东西，将其连接起来
	
	var panel = new Ext.grid.GridPanel({
		cm:cm,
		sm:sm,
		store:store,
		autoHeight:true,  //设置表格的高度 true为自动获取表格的大小
		renderTo:'grid' , //渲染容器
		enableColumnMove:false,//不可以使表格列移动
		enableColumnResize:false, //不可以改变列的宽度
		stripeRows:false, //True表示为显示行的分隔符
		loadMask:true,  //会有一个Ext.LoadMask的遮罩效果
		trackMouseOver : true,  //True表示为鼠标移动时高亮显示（默认为true）。
		enableDragDrop : true,
		viewConfig:{
			forceFit:true //让没列自动填满表格，根据你设置的宽度按比例分配
		},
		bbar:new Ext.PagingToolbar({
			pageSize:3,  //每页显示几条
			store:store,
			displayInfo:true,
			displayMsg:'显示{0}，到{1}条，一共{2}',  //固定写法
			emptyMsg:'无此记录'
		})
	});
	store.load({params:{start:0,limit:3}});//加载数据  注意，一旦使用了分页条， store.load();就必须在构造表格之后进行执行，否则将不起作用，并且将分页条和数据源关联，从而实现与表格共享数据模型

	//右面表单信息
	var form=new Ext.form.FormPanel({
		frame:true,
		height:80,
		buttonAlign:'top',
		labelAlign:'right',
		layout:'form',
		items:[{
			layout:'column',
			height:40,
			items:[{
				layout:'form',
				columnWidth:.22,  
				items:[{
					fieldLabel:'填写人姓名',
					xtype:'textfield'
				}]	
			},{
				layout:'form',
				items:[{
					fieldLabel:'检索关键字',
					xtype:'textfield'
				}]
				
			}]		
		}],
		buttons:[{
	    	text: "查看"
	      /*  handler:function(){ 
	        alert('-----------');
	        form.form.submit({   
	        	waitMsg : ' ......',   
	            url:'AssortAimTypeAdd.action',   
	            params: {datasrcid:datasrc},   
	            method:'post',   
	            success:function(action,form){   
	            	alert('success');   
	                Ext.MessageBox.confirm('success', 'is success！');   
	                //ds.reload();   
	                    //myFormWin4.hide();   
	             },   
	             failure:function(action,form){   
	                alert(action.failureType);   
	              }
	          }); 
	       }*/
	     },'-',{
	            text: "查询"
	        },'-',{
	        	text: "删除"
	        },'-',{
	        	text: "修改"
	        },'-',{
	        	text: "增加"
	        },'-',{	
	        	hidden:true,
				width:70	
			}]
	});
	
	 new Ext.Viewport({  
		layout : 'border', // 使用border布局  
		border:false,
		items:[{
			
			region:'center',
			border:false,
			items:[form,panel]
		}]
	 }); 
	 
});
</script> 	
</head>
<body>
<div id="grid"></div>
</body>
</html>